<?php
class Zendvn_View_Helper_AdminTableBody extends Zend_View_Helper_Abstract{
    
    public function adminTableBody($name = null,$value = null,$attribs = null,$options = null ){
    	
    	$view= $this->view;
    	foreach ($value as $key => $val){
    		if ($val['primary']) $primaryId = $val['data'];
    		switch ($val['contentType']){
    			case 'simpleText': 
    					$input = $val['data'];
    					break;
    			case 'link': 
    					$link = $view->zenjooUrl(array(
    													'option'  =>$val['target']['option'],
    													'control' =>$val['target']['control'],
    													'activity'=>$val['target']['activity'],
    													'cid'	  =>$primaryId
    												),
    									'admin-'.$component['name'].'-'.$component['control'].'-'.$button['target']['activity'],array(),false);
    					$input = '<a href="'.$link.'">'.$val['data'].'</a>';
    					break;
    			default:
    					$input = $val['contentType'];
    					$input = $view->$input($name = $key, $val['data'],array('style'=>$val['contentStyle'],'class'=>$val['contentClass']),$options = null);
    			break;
    		}
    		$xhtml .='<td class="'.$val['contentAlign'].'">'.$input.'</td>';
    	}
    	$xhtml = '<td class="center"><input type="checkbox" name="cid[]" onclick="check(this);" title="Checkbox"></td>'.$xhtml;
    	return $xhtml;
    }
}
